package com.mc.lp.database.entity;

import javax.persistence.Column;
import javax.persistence.Entity;


@Entity(name = "ALLERGY")
public class AllergyEntity extends MicroCampusBaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Column(name = "ALLERGY_NAME", nullable = false)
	private String name;
	
	@Override
	public String toString() {
		return "["+this.getName() +" : " + this.getId() + "]";
	}
	
	@Override
	public boolean equals(Object obj) {
		if(obj instanceof AllergyEntity){
			if(((AllergyEntity)obj).getId()==this.getId() || ((AllergyEntity)obj).getName().equalsIgnoreCase(this.getName())){
				return true;
			}
		}
		return false;
	}
	
	@Override
	public int hashCode() {
		return (int) (getId()*7L);
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
}
